/***************************************************************
*  Copyright (c) 2007 by GroupMe! Team (www.groupme.net)
*  All rights reserved.
*
*  This file is part of the GroupMe! Project. Source code of 
*  this project is closed and redistribution of this code is
*  prohibited. 
*  
*  Contact: http://www.groupme.net
*
*  This copyright notice MUST APPEAR in all copies of the file!
***************************************************************/
package net.groupme.search.strategy.model;

import net.groupme.model.Group;
import net.groupme.model.Identifiable;

/**
 * created on Jul 4, 2007
 * 
 * This class defines a simple structure for assigning weights to groups.
 * 
 * @author Fabian Abel, <a href="mailto:abel@l3s.de">abel@l3s.de</a>
 * @author last edited by: $Author: fabian $
 * 
 * @version $Revision: 1.3 $ $Date: 2008-01-15 02:24:02 $
 */
public class WeightedGroup extends AbstractWeightedIdentifiable{

	/** the group that is assigned with a weight */
	public Group group;
	
	/** the weight that is associated to the group */
	public double weight;
	
	/**
	 * Creates a new WeightedGroup instance.
	 * @param group group that is assigned with a weight 
	 * @param weight weight that is associated to the group
	 */
	public WeightedGroup(Group group, double weight){
		this.group = group;
		this.weight = weight;
	}

	/* (non-Javadoc)
	 * @see net.groupme.search.strategy.model.AbstractWeightedIdentifiable#getIdentifiable()
	 */
	@Override
	public Identifiable getIdentifiable() {
		return group;
	}

	/* (non-Javadoc)
	 * @see net.groupme.search.strategy.model.AbstractWeightedIdentifiable#getWeight()
	 */
	@Override
	public double getWeight() {
		return weight;
	}

	/* (non-Javadoc)
	 * @see net.groupme.search.strategy.model.AbstractWeightedIdentifiable#clone()
	 */
	@Override
	public AbstractWeightedIdentifiable clone() {
		return new WeightedGroup(this.group, this.weight);
	}
	
}
